﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Upeu.Venta.Data.Entities;

namespace Upeu.Venta.Data.Mappings
{
    public class ComprasMap : EntityTypeConfiguration<Compras>
    {
        public ComprasMap()
        {
            //cambiar nombre table
            ToTable("Comprass");

            //pk
            HasKey(t => t.Id);
            Property(t => t.Id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            //campos
            Property(t => t.Serie).IsOptional();
            Property(t => t.NumDoc).IsOptional();
            Property(t => t.FechaCompra).IsRequired();
            Property(t => t.FechaRegistro).IsRequired();
        }
    }
}
